<include file="public@header" />
<style>
    .custom-checkbox{top:5px;}
</style>
</head>
<body>
    <div class="layui-fluid">
        <form method="post" class="layui-form js-ajax-form" action="{:url('user/addpost')}">
            <div class="layui-card">
                <div class="layui-card-header">{:lang('ADMIN_USER_ADD')}</div>
                <div class="layui-card-body">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="form-required">*</span>{:lang('USERNAME')}</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="user_login">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="form-required">*</span>{:lang('PASSWORD')}</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="user_pass" placeholder="******">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="form-required">*</span>{:lang('EMAIL')}</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="user_email">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="form-required">*</span>{:lang('ROLE')}</label>
                        <div class="layui-input-block">
                            
                            <foreach name="roles" item="vo">
                                <input value="{$vo.id}" type="checkbox" name="role_id[]" title="{$vo.name}" lay-skin="primary" <if condition="cmf_get_current_admin_id() neq 1 && $vo['id'] eq 1">disabled="true"</if>>
                            </foreach>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <if condition="cmf_auth_check(cmf_get_current_admin_id(), 'admin/User/addPost')">
                                <button type="submit" class="layui-btn layui-btn-normal js-ajax-submit">{:lang('ADD')}</button>
                            </if>
                            <a class="layui-btn layui-btn-primary" href="javascript:history.back(-1);">{:lang('BACK')}</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
<include file="public@footer" />
